# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: csslayer <wengxt AT gmail com>

pkgname=fcitx5-configtool
pkgver=5.1.2
pkgrel=1
pkgdesc="Configuration Tool for Fcitx5"
arch=('loong64' 'x86_64')
url="https://github.com/fcitx/fcitx5-configtool"
license=('GPL')
groups=('fcitx5-im')
provides=('fcitx5-config-qt' 'kcm-fcitx5')
conflicts=('kcm-fcitx5')
replaces=('kcm-fcitx5')
depends=('fcitx5-qt' 'kwidgetsaddons5' 'kitemviews5' 'qt5-x11extras')
optdepends=('kdeclarative5: for KCM support'
            'kirigami2: for KCM support'
            'plasma-framework5: for fcitx5-plasma-theme-generator')
makedepends=('extra-cmake-modules' 'kdeclarative5' 'kirigami2' 'ninja' 'python' 'plasma-framework5')
source=("https://download.fcitx-im.org/fcitx5/$pkgname/$pkgname-$pkgver.tar.xz"{,.sig})
sha512sums=('66271146d0867f629d9dfe193c4b9a0aa5e3f81ecd94fc3e8e6273a7332bcddb321f4993e7fc3794bd1172aceaaa21f9bab7449b45b1a23b6523ecd67712ad84'
            'SKIP')
validpgpkeys=('2CC8A0609AD2A479C65B6D5C8E8B898CBF2412F9') # Weng Xuetian <wengxt@gmail.com>

prepare() {
  mkdir -p build
}

build(){
  cd build

  cmake -GNinja -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=/usr/lib -DKDE_INSTALL_USE_QT_SYS_PATHS=ON ../$pkgname-$pkgver
  ninja
}

package() {
  cd build
  DESTDIR="$pkgdir" ninja install
}
